package com.cqs.leetcode.string;

import java.util.Arrays;

public class CheckPermutationLCCI  {

    public boolean CheckPermutation(String s1, String s2) {
        char[] chars1 = s1.toCharArray();
        Arrays.sort(chars1);
        char[] chars2 = s2.toCharArray();
        Arrays.sort(chars2);
        return Arrays.equals(chars1,chars2);
    }

    public static void main(String[] args) {
        CheckPermutationLCCI c = new CheckPermutationLCCI();

        System.out.println(c.CheckPermutation("abc","bca"));
        System.out.println(c.CheckPermutation("abc","aca"));
    }
}
